package main;

import java.util.ArrayList;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.AfterClass;

public class TestRockPaperScissorsPlayers {
	
	RockPaperScissors rps;
	Player p1,p2,p3,p4;

	
  @BeforeClass
  public void setUpClass() {
	  rps= new RockPaperScissors();
	  
	  ArrayList<RPSEnum> liste1 = new ArrayList<RPSEnum>();
	  liste1.add(RPSEnum.ROCK);
	  liste1.add(RPSEnum.PAPER);
	  liste1.add(RPSEnum.SCISSORS);
	  liste1.add(RPSEnum.ROCK);
	  liste1.add(RPSEnum.PAPER);
	  p1=new Player("Antoine",liste1);
	  
	  ArrayList<RPSEnum> liste2 = new ArrayList<RPSEnum>();
	  liste2.add(RPSEnum.SCISSORS);
	  liste2.add(RPSEnum.SCISSORS);
	  liste2.add(RPSEnum.ROCK);
	  liste2.add(RPSEnum.SCISSORS);
	  liste2.add(RPSEnum.ROCK);
	  p2=new Player("Luc",liste2);
	  
	  
	  //Generation aléatoire
	  p3=new Player("Jean");
	  p4=new Player("Michel");
  }




  @Test
  public void TestWinPlayers() {
    assert Result.WIN.equals(rps.play(this.p1,this.p2));
  }
  
  @Test
  public void TestFailPlayers() {
    assert Result.LOST.equals(rps.play(this.p2,this.p1));
  }
  
  @Test
  public void TestTiePlayers() {
    assert Result.TIE.equals(rps.play(this.p1,this.p1));
  }
  
  
  /*
  @Test
  public void TestRandomPlay() {
    assert Result.WIN.equals(rps.play(this.p3,this.p4));
  }
  */
  
  
  @AfterClass
  public void tearDownClass() {
	  rps=null;
	  p1=null;
	  p2=null;
	  
	  rps=null;
  }
}
